/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.sorbonne.soa.ws;

import fr.sorbonne.soa.entity.Customerorder;
import fr.sorbonne.soa.entity.Productinfo;
import fr.sorbonne.soa.lib.ManagerDistributorLocal;
import fr.sorbonne.soa.lib.ProductToDistributor;
import javax.ejb.EJB;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ejb.Stateless;

/**
 *
 * @author Cid
 */
@WebService()
@Stateless()
public class DistributorCustomerWS {
    @EJB
    private ManagerDistributorLocal managerDistributorBean;

    /**
     * Web service operation
     */
    @WebMethod(operationName = "createOrder")
    @Oneway
    public void createOrder(@WebParam(name = "productInfo")
    Productinfo productInfo, @WebParam(name = "quantity")
    int quantity) {
        managerDistributorBean.createOrder(productInfo, quantity);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "payOrder")
    public void payOrder(@WebParam(name = "order")
    Customerorder order, @WebParam(name = "amount")
    Double amount) {
        managerDistributorBean.receiveCustomerPayment(order, amount);
    }


}
